package cn.wonderland.fallback;

import cn.wonderland.domain.User;
import cn.wonderland.feign.UserFeignClient;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class UserFeignFallBackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        throwable.printStackTrace();
        return userId -> new User(-2L,"进入熔断降级！！！！",null,null);
    }
}
